﻿using CommonLibrary.Models;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Data;
using System.Linq;
using BLToolkit.Data.DataProvider;
using BLToolkit.Data.Linq;
using BLToolkit.Reflection;


namespace CommonSite.Tests
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            using (var conn = new Npgsql.NpgsqlConnection("Server=127.0.0.1;Port=5432;User=postgres;Password=hongyuan;Database=XkDB;"))
            using (var cmd = new Npgsql.NpgsqlCommand("select 0::bit;", conn))
            {
                conn.Open();

                object result = cmd.ExecuteScalar();
                Assert.Inconclusive("result = {0}, type is {1}", result, result.GetType());
            }
        }

        [TestMethod]
        public void TestMethod2()
        {
            CommonDatabase.AddDataProvider(new PostgreSQLDataProvider());
            using (CommonDatabase db = new CommonDatabase(CommonOption.ReadWrite))
            {
            }
        }
    }
}
